﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Create.aspx.cs" Inherits="H2.NET.Web.Management.Account.Create" %>
<%@ Register Assembly="H2.NET.Controls" Namespace="H2.NET.Controls" TagPrefix="H2" %>

<script type="text/javascript">

    $(document).ready(function () {

        $("#roles", $.pdialog.getCurrent()).select2({
            placeholder: "点击这里选择一个角色..."
        });

    });

    function buttonClick() {

        $.ajax({
            url: "/Page/User/Create.aspx?action=buttonClick",
            type: "POST",
            data: { name: "keyun" },
            dataType: "json",
            success: function (result) {

                dialogAjaxDone(result);

            }
        });


        //        $("#Username", navTab.getCurrentPanel()).val($("#Username", $.pdialog.getCurrent()).val());

        //        $.pdialog.closeCurrent();

        //        navTabSearch($("#pagerForm", navTab.getCurrentPanel()));

    }
    function change() {
        $.ajax({
            url: "/Page/User/Create.aspx?action=change&depart=" + escape(document.getElementById("ddl_Depart").value),

            type: "POST",
            data: { name: "keyun" },
            dataType: "html",
            success: function (result) {
                $("#ddl_GW", $.pdialog.getCurrent()).html("");
                $("#ddl_GW", $.pdialog.getCurrent()).append(result);

            }
        });
    }

    function winOpenPopup(strURL, str_width, str_height, str_value, str_element, str_postback, str_multiple) {
        var json = window.showModalDialog(
                strURL + "&vt=" + new Date(),
                '',
                "dialogWidth=" + (parseInt(str_width) + 30) + "px;dialogHeight=" + str_height + "px;dialogLeft: status:no; directories:yes;scrollbars:auto;Resizable=yes;");

        if (json != null && json != "" && json != undefined) {
            var obj = eval('(' + json + ')');
            $("#associateName", $.pdialog.getCurrent()).val(obj.a);

        } else {
            $("#associateName", $.pdialog.getCurrent()).val("");
        }
    }
</script>
<div class="page">
    <div class="pageContent">
        <form method="post" action="Management/Account/Create.aspx?action=save" class="pageForm required-validate"
        onsubmit="return validateCallback(this, dialogAjaxDone);" runat="server">
        <div class="pageFormContent" layouth="49">
            <table class="formTable">
                <tr>
                    <th>
                        <label>
                            用户名：</label>
                    </th>
                    <td>
                        
                        <H2:Dialog ID="associateName" runat="server" ReadOnly CssClass="required" Width="162px" Dialog_ID="SYS-0007"></H2:Dialog>
                    </td>
                </tr>
                <tr style="display:none;">
                    <th><label>状态：</label></th>
                    <td>
                        <input type="radio" name="Status" value="true" checked />启用
                        <input type="radio" name="Status" value="false" />不启用
                    </td>
                </tr>
                <%--<tr>
                    <th>
                        <label>
                            密码：</label>
                    </th>
                    <td>
                        <input type="password" id="newPassword" name="newPassword" size="30" minlength="6"
                            maxlength="20" class="required alphanumeric" />
                    </td>
                </tr>
                <tr>
                    <th>
                        <label>
                            确认密码：</label>
                    </th>
                    <td>
                        <input type="password" name="rnewPassword" size="30" equalto="#newPassword" class="required alphanumeric" />
                    </td>
                </tr>--%>
                <tr>
                    <th><lable>角色配置：</lable></th>
                    <td>
                        <select multiple style="width: 100%;" name="roles" id="roles">
                            <asp:literal runat="server" ID="l_options"></asp:literal>
                        </select>
                    </td>
                </tr>
            </table>
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit">
                                提交</button></div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent">
                            <button class="close">
                                关闭</button></div>
                    </div>    
                </li>
            </ul>
        </div>
        </form>
    </div>
</div>